var addScroller = function () {
  var scroller = document.createElement('div'),
        tempScroll;
  
  scroller.className = 'scroller';
  scroller.innerHTML = '<span>scroll up</span>'

  window.onload = function () { 
    scroller.onclick = function () {
      var currentPosition = document.body.scrollTop;

      if (currentPosition !== 0) { 
        tempScroll = currentPosition;
        window.scrollTo(0, 0);
      } else { 
        window.scrollTo(0, tempScroll);        
      }
    }
    document.body.appendChild(scroller); 
  };
};